Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save single audio file & script when completed in demo app #42

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

Kostis-S-Z
Copy link
Contributor

@Kostis-S-Z Kostis-S-Z commented Dec 5, 2024

What's changing

In the demo app, when the script and audio generation of the whole podcast is complete, we want to save the complete audio as a single audio file and the complete script as a text file. This PR is an implementation of two buttons that enable this feature.

Closes #33

How to test it

Steps to test the changes:

  1. Install package pip install -e .
  2. Run demo app python -m streamlit run demo/app.py
  3. Generate a podcast and wait for it to finish
  4. Click "Save Podcast to audio file" and verify that a podcast.wav file is generated under the root directory
  5. Click "Save Podcast script to text file" and verify that a script.txt file is generated under the root directory

Additional notes for reviewers

Currently the generated podcast text disappears when you click one of the two buttons.

I already...

  • Tested the changes in a working environment to ensure they work as expected
  • Added some tests for any new functionality
  • Updated the documentation (both comments in code and under /docs)

@Kostis-S-Z Kostis-S-Z linked an issue Dec 5, 2024 that may be closed by this pull request
demo/app.py Outdated Show resolved Hide resolved
@Kostis-S-Z Kostis-S-Z marked this pull request as ready for review December 9, 2024 08:41
Copy link
Contributor

@stefanfrench stefanfrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kostis-S-Z - looking good. One thing I noticed is that once you click 'save the audio', it removes all the text and audio snippets above. Is there any way we can keep those after the user has clicked save?

@Kostis-S-Z
Copy link
Contributor Author

Kostis-S-Z commented Dec 9, 2024

@Kostis-S-Z - looking good. One thing I noticed is that once you click 'save the audio', it removes all the text and audio snippets above. Is there any way we can keep those after the user has clicked save?

Well its a bit tricky. Since we are "streaming" the text and the audio as they being generated, its not trivial to make them persistent after clicking a button goes then you need to re-render them. But if you try to do that it will show up like this

image

If @daavoo has a magic trick to fix this then I am happy to implement it!

@stefanfrench stefanfrench self-requested a review December 9, 2024 16:42
@stefanfrench
Copy link
Contributor

@Kostis-S-Z - Okay no worries if its too tricky, its not essential.

@daavoo
Copy link
Contributor

daavoo commented Dec 9, 2024

If @daavoo has a magic trick to fix this then I am happy to implement it!

Have you checked https://docs.streamlit.io/develop/concepts/architecture/fragments ?

@daavoo daavoo force-pushed the 33-modify-demo-app-to-generate-single-audio-output branch from 498e871 to 5940dad Compare December 9, 2024 20:31
@Kostis-S-Z
Copy link
Contributor Author

If @daavoo has a magic trick to fix this then I am happy to implement it!

Have you checked https://docs.streamlit.io/develop/concepts/architecture/fragments ?

I will take a look! Would you be okay if we merge this as is for now, and I work on this later in a different PR? I feel like its a bit lower priority right now

@daavoo
Copy link
Contributor

daavoo commented Dec 10, 2024

If @daavoo has a magic trick to fix this then I am happy to implement it!

Have you checked https://docs.streamlit.io/develop/concepts/architecture/fragments ?

I will take a look! Would you be okay if we merge this as is for now, and I work on this later in a different PR? I feel like its a bit lower priority right now

ok, lets consider it a follow-up. I still haven't review the code changes, though

@Kostis-S-Z Kostis-S-Z merged commit 59d2e5f into main Dec 11, 2024
2 checks passed
@Kostis-S-Z Kostis-S-Z deleted the 33-modify-demo-app-to-generate-single-audio-output branch December 11, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify demo app to generate single audio output
3 participants